package biz

import (
	"context"

	v1 "x-admin/api/helloworld/v1"

	"github.com/go-kratos/kratos/v2/errors"
	"github.com/go-kratos/kratos/v2/log"
)

var (
	// ErrUserNotFound is user not found.
	ErrUserNotFound = errors.NotFound(v1.ErrorReason_USER_NOT_FOUND.String(), "user not found")
)

type LoginReturns struct {
	Token string
}

// AuthUsecase is a Auth usecase.
type AuthUsecase struct {
	auRepo AdminUserRepo
	log    *log.Helper
}

// NewAuthUsecase new a Auth usecase.
func NewAuthUsecase(auRepo AdminUserRepo, logger log.Logger) *AuthUsecase {
	return &AuthUsecase{auRepo: auRepo, log: log.NewHelper(logger)}
}

// CreateAuth creates a Auth, and returns the new Auth.
func (uc *AuthUsecase) Login(ctx context.Context, au *AdminUser) (*LoginReturns, error) {
	uc.log.WithContext(ctx).Infof("CreateAuth: %v", au.Id)
	return &LoginReturns{
		Token: "",
	}, nil
}
